import Vue from "vue";
import Vuex from "vuex";
import user from "./modules/user";
import common from "./modules/common";
import tags from "./modules/tags";
import logs from "./modules/logs";
import dict from "./modules/dict";
import getters from "./getters";
import { pageSetting } from "@/views/form/data/pageSetting";

Vue.use(Vuex);
const store = new Vuex.Store({
  state: {
    isDrop: false, //是否正在拖动
    isEnterMobilePhone: false, //鼠标是否进入屏幕区域

    currentCom: {}, //当前拖拽得组件

    isEditPon: false, //是否正在编辑位置顺序

    enterPonCom: {}, //插入在哪个组件
    enterPonIndex: null, //插入在组件的位置
    enterPonIndexType: null, //插入在组件的上面还是下面

    currentExitComPinIndex: null, //当前编辑的组件位置

    jsonData: [pageSetting],

    menuIndex: null, //操作

    menuStr: null,
  },
  mutations: {
    changejsonData(state, data) {
      state.jsonData = data;
    },
  },
  modules: {
    user,
    common,
    logs,
    tags,
    dict,
  },
  getters,
});

export default store;
